package com.llf.ojmiaobackendjudgeservice.controller.inner;

import com.llf.ojmiaobackendjudgeservice.judge.JudegService;
import com.llf.ojmiaobackendmodel.model.entity.QuestionSubmit;
import com.llf.ojmiaobackendserviceclient.service.JudegFeignClient;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 内部调用
 */
@RestController
@RequestMapping("/inner")
public class JudgeInnerController implements JudegFeignClient {

    @Resource
    private JudegService judegService;

    /**
     * 判题服务
     * @param questionSubmitId
     * @return
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId") long questionSubmitId){
        return judegService.doJudge(questionSubmitId);
    }
}
